<template>
  <div class="drawer-container">
    <div>
      <div class="drawer-item">
        <span>主题颜色</span>
        <theme-picker
          style="float: right;height: 26px;margin: -3px 8px 0 0;"
          @change="themeChange"
        />
      </div>

      <div class="drawer-item">
        <span>首页工具栏</span>
        <el-switch v-model="indexTool" class="drawer-switch" />
      </div>
      <div class="drawer-item">
        <span>历史导航栏</span>
        <el-switch v-model="showHistry" class="drawer-switch" />
      </div>

      <!-- <div class="drawer-item">
        <span>Fixed Header</span>
        <el-switch v-model="fixedHeader" class="drawer-switch" />
      </div>-->

      <div class="drawer-item">
        <span>导航栏Logo</span>
        <el-switch v-model="sidebarLogo" class="drawer-switch" />
      </div>
    </div>
  </div>
</template>

<script>
import ThemePicker from "./ThemePicker/index";

export default {
  components: { ThemePicker },
  data() {
    return {};
  },
  computed: {
    // fixedHeader: {
    //   get() {
    //     return this.$store.state.settings.fixedHeader
    //   },
    //   set(val) {
    //     this.$store.dispatch('settings/changeSetting', {
    //       key: 'fixedHeader',
    //       value: val
    //     })
    //   }
    // },
    showHistry: {
      get: function() {
        return this.$store.state.settings.showHistry;
      },
      set: function(nv) {
        this.$store.commit("showHistry", nv);
      }
    },
    // tagsView: {
    // get() {
    //   return this.$store.state.settings.tagsView
    // },
    // set(val) {
    //   this.$store.dispatch('settings/changeSetting', {
    //     key: 'tagsView',
    //     value: val
    //   })
    // }
    // },
    sidebarLogo: {
      get() {
        return this.$store.state.settings.sidebarLogo;
      },
      set(val) {
        this.$store.commit("sidebarLogo", val);
      }
    },
    indexTool: {
      get() {
        return this.$store.state.settings.indexTool;
      },
      set(val) {
        this.$store.commit("indexTool", val);
      }
    }
  },
  methods: {
    themeChange(val) {
      this.$store.commit("theme", val);
    }
  }
};
</script>

<style lang="scss" scoped>
.drawer-container {
  padding: 24px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;

  .drawer-item {
    color: rgba(0, 0, 0, 0.65);
    font-size: 14px;
    padding: 12px 0;
  }

  .drawer-switch {
    float: right;
  }
}
</style>
